package com.jvtd.nettyim.im.client.console;

import com.jvtd.nettyim.im.protocol.request.MessageRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

/**
 * @author Created by neal.zhang
 * @date 2020/6/1 - 11:53
 */
public class SendToUserConsoleCommand implements ConsoleCommand{
    @Override
    public void exec(Scanner scanner, Channel channel) {
        System.err.println("发送消息给用户.");
        String toUserId=scanner.next();
        String message = scanner.next();
        channel.writeAndFlush(new MessageRequestPacket(toUserId,message));
    }
}
